<% 
  paginate_sales = sale_events.paginate(:active_sale_events_per_page) if Spree::ActiveSaleConfig[:paginate_sale_events_for_user?]
  paginate_sales ||= sale_events
%>

<% if sale_events.empty? %>
  <%= t('spree.active_sale.events_not_found') %>
<% else %>
  <ul id="sale_events" class="inline product-listing" data-hook>
    <% sale_events.each do |sale_event| %>
      <% if sale_image_available?(sale_event) %>
        <li id="active_sale_<%= sale_event.id %>" class="columns three <%= cycle("alpha", "secondary", "", "omega secondary", :name => "classes") %>" data-hook="active_sales_list_item" itemscope itemtype="http://schema.org/Offer">
          <div class="sale_event-image">
            <%= link_to small_event_image(sale_event, :itemprop => "image"), sale_event.permalink, :itemprop => 'url' %>
          </div>
          <%= link_to truncate(sale_event.name, :length => 50), sale_event.permalink, :class => 'info', :itemprop => "name", :title => sale_event.name %>
          <br>
          <%= sale_event_timer(sale_event) %>
        </li>
      <% end %>
    <% end %>
    <% reset_cycle("classes") %>
  </ul>
<% end %>

<% if paginate_sales.respond_to?(:num_pages) %>
  <%= paginate paginate_sales %>
<% end %>
